<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="author" content="wangbo">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    * {
      margin: 0px;
      padding: 0px;
    }

    table {
      width: 500px;
    }

    tr,
    td,
    th {
      border: 1px solid #ccc;
      border-collapse: collapse;
    }
  </style>
</head>

<body>
  <div id="i1">做任何毫不费力的事情,都是在浪费时间</div>
  <script>
    function func() {
      // 根据ID获取指定标签的内容,定于局部变量接受
      var tag = document.getElementById('i1');
      // 获取标签内部的内容
      var content = tag.innerText;

      var f = content.charAt(0);
      var l = content.substring(1, content.length);

      var new_content = l + f;

      tag.innerText = new_content;
    }
    setInterval(func, 500);


  </script>


</body>

</html>